package com.xh.core.util;

import org.junit.Test;

import static org.junit.Assert.*;

public class FileUtilsTest {
    @Test
    public void changeExt() throws Exception {
        String result1=FileUtils.changeExt("/user/1.txt","doc");
        assertEquals(result1,"/user/1.doc");
        String result2=FileUtils.changeExt("/user/1","doc");
        assertEquals(result2,"/user/1.doc");
        String result3=FileUtils.changeExt("/user/1.txt","");
        assertEquals(result3,"/user/1");
    }

}